<div class="panelTabs">
			<div class="tabs">
				<a class="selected" title="Messages">{'Messages'|t} ({$messagesCount})</a>
				<a title="Messages">{'Notifications'|t} ({$noticeCount})</a>
			</div>
		
		<div class="backgroundFrame970Top"></div>
		<div class="backgroundFrame970"><div class="content">
		
			<div class="tabPanel">
				<form action="{url label=current}" method="post" id="allMessages">
				<table class="messages" cellpadding="0" cellspacing="0">
					<th class="check"></th>
					<th>{'date'|t}</th>
					<th>{'user'|t}</th>
					<th>{'message'|t}</th>
					<th></th>
					{foreach from=$messages item=message}
					<tr
{if ($message->getIdUser()!=$_user->getId() && $message->getReadedRecipient()=='0')  || ($message->getIdUser()!=$_user->getId() && $message->getThreadReadedRecipient()=='0') || ($message->getIdUser()==$_user->getId() && $message->getThreadReadedUser()=='0')}class="receivedNew"{/if}>

						<td class="check"><input type="checkbox" name="msg{$message->getId()}" class="msg"/></td>
						<td class="date">{$message->getDate()}</td>
						<td class="user">
							<div class="userItem">
								<a href="{url label=userProfile idUser=$message->user->GetId()}" title="{$message->user->getFirstName()} {$message->user->getLastName()}"><img src="{$urlStatic}/{image src=$message->user->getAvatar() w=25 h=25}" alt="{$message->user->getFirstName()} {$message->user->getLastName()}" class="thumb"/></a>
								<p class="username"><a href="{url label=userProfile idUser=$message->user->GetId()}" title="{$message->user->getFirstName()} {$message->user->getLastName()}">{$message->user->getFirstName()} {$message->user->getLastName()}</a> <img src="{$urlStatic}/image/Strona/rank3.png" alt="{'rank'|t}"/><br/>{$message->user->getLocation()}</p>							
							</div>
						</td>
						<td class="message">
							<h5>{if $message->getType()<1}<a href="{url label=messagesThread threadId=$message->getId()}">{/if}{$message->getTitle()}{if $message->getType()<1}</a>{/if}</h5>
							{if $message->getType()<1}<a href="{url label=messagesThread threadId=$message->getId()}">{/if}{if ($message->getIdUser()!=$_user->getId() && $message->getReadedRecipient()=='0')  || ($message->getIdUser()!=$_user->getId() && $message->getThreadReadedRecipient()=='0') || ($message->getIdUser()==$_user->getId() && $message->getThreadReadedUser()=='0')}<b>{/if}{$message->getContent()}{if ($message->getReadedUser()=='0' && $message->getIdUser()!=$_user->getId()) || $message->getThreadReadedUser()=='1'}</b>{/if}{if $message->getType()<1}</a>{/if}
						</td>
						<td class="options">{if $message->getType()<1 && !isset($threadView)}<a href="{url label=messagesThread threadId=$message->getId()}" class="sendMessage">{'read'|t}</a>
						{else}
						{if $message->getReadedRecipient()=='0' && $message->getIdUser()!=$_user->getId() && !isset($threadView)}
						<a href="{url label=messagesThread threadId=$message->getId()}?action=accept" rel="nofollow">{'accept'|t}</a>
						<a href="{url label=messagesThread threadId=$message->getId()}?action=reject" rel="nofollow">{'reject'|t}</a>
						{/if}
							{/if}
						</td>
					</tr>
					{foreachelse}
					<tr>
						<td colspan="5">{'there is no messages'|t}</td>
					</tr>
					{/foreach}
					
					
					
					
					
					
					
				</table>
				{if count($messages)>0}
				<div class="messagesButtons">
					<a title="Select all mesages" class="selectAll">select all</a>
					<a title="invert selection" class="selectInvert">invert selection</a>
					<a title="invert selection" class="emptyList" onclick="$('#allMessages').submit();">delete selected</a>
				</div>
				{/if}
				<input type="hidden" name="deleteMessages" value="1" />
				</form>
			{if isset($enableReply)}	
				<div class="form formNewMessage">
			
			<form action="{url label=current}" id="messageForm" method="post">
				
				<div class="formItem">
					<p class="label">{'message'|t}</p>
					<textarea rows="3" cols="10" name="message" id="message" rel="{'write your message'|t}">{'write your message'|t}</textarea>
					<input type="hidden" name="recipientId" value="{$recipientId}" />
				</div>
				
				<div class="formSubmit">
					<input type="submit" name="send" value="{'Send message'|t}" class="button" />
				</div>
			</form>
			</div>
			{/if}	
				
			</div>
			
			<div class="tabPanel hidden">
				<table class="messages" cellpadding="0" cellspacing="0">
					<th class="check"></th>
					<th>date</th>
					<th>message</th>
					<th></th>
					
					{foreach from=$notice item=message}
					<tr>
						<td class="check"><input type="checkbox" name="msg1" class="msg"/></td>
						<td class="date">{$message->getDate()}</td>
						<td class="user">
							<div class="userItem">
								<a href="#" title="Username"><img src="{$urlStatic}/{image src=$message->user->getAvatar() w=25 h=25}" alt="Username" class="thumb"/></a>
								<p class="username"><a href="#" title="Username">{$message->user->getFirstName()} {$message->user->getLastName()}</a> <img src="images/rank3.png" alt="rank"/><br/>{$message->user->getLocation()}</p>							
							</div>
						</td>
						<td class="message">
							<h5><a href="{url label=messagesThread threadId=$message->getId()}">{$message->getTitle()}</a></h5>
							<a href="{url label=messagesThread threadId=$message->getId()}">{if $message->getReaded()=='0' && $message->getIdUser()!=$_user->getId()}<b>{/if}{$message->getContent()}{if $message->getReaded()=='0' && $message->getIdUser()!=$_user->getId()}</b>{/if}</a>
						</td>
						<td class="options"><a href="{url label=messagesThread threadId=$message->getId()}" class="sendMessage">read</a></td>
					</tr>
					{foreachelse}
					<tr>
						<td colspan="5">{'there is no notices'|t}</td>
					</tr>
					{/foreach}
					
					
					
					
					
					
					
				</table>
				{if $noticeCount>0}
				<div class="messagesButtons">
					<a title="Select all mesages" class="selectAll">select all</a>
					<a title="invert selection" class="selectInvert">invert selection</a>
					<a title="invert selection" class="emptyList">delete selected</a>
				</div>
				{/if}
					
				
				
				
			</div>
		</div></div>
		<div class="backgroundFrame970Bottom"></div>
		</div>
<script type="text/javascript">
	{literal}
	
	var txt = $('#message').attr('rel');
	var form = $('#messageForm');
	$('#message').focusin(function(){
		if($(this).val() == txt) $(this).val("");
	}).focusout(function(){
		if($(this).val().trim().length == 0) $(this).val(txt);
	})	
	$(form).submit(function(){
		if($('#message').val() == txt) {return false; }
		return true;
	});
	
	
	$('textarea#message').autoResize({
    // On resize:
    onResize : function() {
        $(this).css({opacity:0.8});
    },
    // After resize:
    animateCallback : function() {
        $(this).css({opacity:1});
    },
    // Quite slow animation:
    animateDuration : 300,
    // More extra space:
    extraSpace : 10
});
{/literal}
</script>